﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<table id="listNotice">
    <tr>
        <th>ID</th>
        <th>TITOLO</th>
        <th>CATEGORIA</th>
        <th>STATO</th>
        <th>DATA CREAZIONE</th>
        <th>DATA PUBBLICAZIONE</th>
        <th>MODIFICA</th>
        <th>ELIMINA</th>
    </tr>
    <% foreach (var notice in (List<MvcSite.Models.Notizia>)ViewData["ListNotice"])
       {
    %>
            <tr>
                <td>
                    <%= notice.Id %>
                </td>
                <td>
                    <%= notice.Titolo %>
                </td>
                <td>
                    <%= notice.Categoria %>
                </td>
                <td>
                    <%= notice.Stato %>
                </td>
                <td>
                    <%= notice.DataCreazione %>
                </td>
                <td>
                    <%= notice.DataPub %>
                </td>
                <td>
                    <%: Html.ActionLink("Modifica", "ModificaNotice", "Notizie", new { id = notice.Id }, null)%>
                </td>
                <td>
                    <a href="#" onclick = "elimina('<%=  notice.Id %>')">Elimina</a>
                </td>
            </tr>
    <%
       }       
    %>

</table>